package ar.com.candoit.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import ar.com.candoit.beans.Adress;
import ar.com.candoit.dao.AdressDao;

@Service("AdressService")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class AdressServiceImpl implements AdressService {

	@Autowired
	private AdressDao adressDao;

	public AdressServiceImpl() {
	}

	@Transactional(propagation = Propagation.REQUIRED, readOnly = false)
	public void addAdress(Adress adress) {
		adressDao.saveAdress(adress);
	}

	public List<Adress> listAdress() {
		return adressDao.listAdress();
	}

	@Override
	public Adress get(long adressid) {
		return adressDao.get(adressid);
	}

}